package monitor

import (
	"MoSkeleton/framework/core/motypes"
)

type SysOperLog struct {
	ID            uint64          `gorm:"primarykey;autoIncrement=false" json:"id,string"`
	Title         string          `gorm:"column:title;type:VARCHAR(50);"`
	BusinessType  int32           `gorm:"column:business_type;type:INT;"`
	Method        string          `gorm:"column:method;type:VARCHAR(200);"`
	RequestMethod string          `gorm:"column:request_method;type:VARCHAR(10);"`
	OperatorType  int32           `gorm:"column:operator_type;type:INT;"`
	OperName      string          `gorm:"column:oper_name;type:VARCHAR(50);"`
	DeptName      string          `gorm:"column:dept_name;type:VARCHAR(50);"`
	OperUrl       string          `gorm:"column:oper_url;type:VARCHAR(255);"`
	OperIp        string          `gorm:"column:oper_ip;type:VARCHAR(128);"`
	OperLocation  string          `gorm:"column:oper_location;type:VARCHAR(255);"`
	OperParam     string          `gorm:"column:oper_param;type:VARCHAR(2000);"`
	JsonResult    string          `gorm:"column:json_result;type:VARCHAR(2000);"`
	Status        int             `gorm:"column:status;type:INT;"`
	ErrorMsg      string          `gorm:"column:error_msg;type:VARCHAR(2000);"`
	OperTime      *motypes.MoTime `gorm:"column:oper_time;type:DATETIME;"`
	//ms
	CostTime int64 `gorm:"column:cost_time;type:BIGINT;"`
}

func (b *SysOperLog) TableName() string {
	return "sys_oper_log"
}
